﻿using System;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
using StructureMap.TypeRules;
using Ebc.CustomSerializer.Contracts;

namespace Ebc.DesignerDsl
{
    public class SerializerConvention : IRegistrationConvention
    {
        public void Process(Type type, Registry registry)
        {
            var messageModuleType = typeof(IEbcBoardSerializer);

            if (type.IsConcrete() && messageModuleType.IsAssignableFrom(type))
            {
                registry.For(messageModuleType).Use(type).Named(type.FullName);
            }
        }
    }
}